#include <sys/time.h>

struct miniprof_profiledfunction {
	char* name; // name of the function that is being profiled
	unsigned int calls; // total number of calls to this function
	struct timeval ttmin; // time taken to complete, min
	struct timeval ttmean; // time taken to complete, mean
	struct timeval ttmax; // time take to complete, max
	struct timeval tttotal; // total time spent in this function
	unsigned int* callers; // pointer to a set (size of MAXFUNCTIONREGS)
				  // of ints allocated when the function is first profiled
};

int miniprof_start(char* functionname, int regindex);
void miniprof_stop(int regindex);
char* miniprof_funcname(int regindex);
void miniprof_reset(int regindex);
int miniprof_numofregs();
struct miniprof_profiledfunction miniprof_collect(int regindex);
